package logic

import (
	"context"
	"medical/models/mysql"

	"medical/medicalrpc/internal/svc"
	"medical/medicalrpc/medicalrpc"

	"github.com/zeromicro/go-zero/core/logx"
)

type ShopDeleteLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewShopDeleteLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ShopDeleteLogic {
	return &ShopDeleteLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

func (l *ShopDeleteLogic) ShopDelete(in *medicalrpc.ShopDeleteRequest) (*medicalrpc.ShopDeleteResponse, error) {
	// todo: add your logic here and delete this line

	mysql.DB.Debug().Where("id=?", in.Id).Delete(&mysql.Shop{})
	return &medicalrpc.ShopDeleteResponse{}, nil
}
